package com.wakaca.design.pattern.behavioral.observer.guavatest;

import com.google.common.eventbus.EventBus;

/**
 * Created by wakac on 2019/4/3
 */
public class GuavaEventTest {
    public static void main(String[] args) {
        // EventBus 是 guava 实现观察者模式的核心类
        // EventBus 是指事件总线
        EventBus eventBus = new EventBus();
        GuavaEvent guavaEvent = new GuavaEvent();
        // 注册订阅者
        eventBus.register(guavaEvent);
        eventBus.post("post的内容");
    }
}
